/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.querie.util;

import com.querie.collab.CosineItemSimilarity;
import com.querie.collab.ItemSimilarity;
import com.querie.collab.JacItemSimilarity;

/**
 *
 * @author Duc On <ductuanon@hotmail.com>
 */
public class ThreadFragment extends Thread {

    public void run() {
        try {
        ItemSimilarity sim = null;
        QryParameters qParam = QryParameters.getInstance();
        String algoType = qParam.getValue("ALGO");
        if (algoType.equals("jac")) {
            sim = new JacItemSimilarity();
        } else if (algoType.equals("cos")) {
            sim = new CosineItemSimilarity();
        } else {
            throw new Exception("Unknown Algorithm");
        }
        sim.processBackendForAllSessions(null);
        } catch(Exception ex) {
            ex.printStackTrace();
        }
    }
}
